package com.xyc.redis.utils;

import java.util.Random;

public class CodeUtil {

    // 随机生成四位数验证码
    public String getCode() {
        String code = "";
        for (int i = 0; i < 4; i++) {
            int temp = new Random().nextInt(10);
            code += temp;
        }
        return code;
    }
}
